package org.camunda.bpm.getstarted.loanapproval.mapper;

import org.apache.ibatis.annotations.*;
import org.camunda.bpm.getstarted.loanapproval.pojo.entity.*;

import java.util.List;

@Mapper
public interface TicketTaskMapper {

    //    private Long id;
    //    private String taskId;
    //    private Long ticketId;
    //    private Date createTime;
    //    private Date updateTime;
    //    private Long status;
    //    private String prtyCode;


    @Insert("insert into tb_ticket_task(task_id,ticket_Id,create_Time,update_Time,status,prty_Code) values(#{taskId},#{ticketId},#{createTime},#{updateTime},#{status},#{prtyCode})")
    @Options(useGeneratedKeys=true,keyProperty="id")
    Long insert(TicketTaskDO ticketTaskDO);

    @Select("select * from tb_ticket_task where id=#{id}")
    TicketTaskDO selectById(@Param("id") Integer id);


    @Insert("insert into tb_workstation_task(ticketTaskId, workstationId) values(#{ticketTaskId},#{workstationId})")
    @Options(useGeneratedKeys=true,keyProperty="id")
    Long insertWorkstationTask(WorkstationTaskDO workstationTaskDO);

    List<WorkstationGroupDO> selectGroups(@Param("workstationIds") List<Long> workstationIds);

    @Select("select * from tb_workstation where prty_code=#{prtyCode}")
    List<WorkstationDO> selectWorkstations(@Param("prtyCode") String prtyCode);
}
